﻿@{
	Layout = null;
}
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title>@Resources.MeetingList @ConstValues.strDash@Resources.HuiTongCIS</title>
	<link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.5/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.5/themes/icon.css" />
	@Styles.Render("~/Content/css")
	@Styles.Render("~/Content/stylecss")
	@Scripts.Render("~/bundles/modernizr")
	@Scripts.Render("~/bundles/jquery")
	<script type="text/javascript" charset="utf-8" src="~/Scripts/jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="~/Scripts/jquery-easyui-1.4.5/locale/@ViewBag.EasyUiLanguage"></script>
	@Scripts.Render("~/bundles/common")
	<script type="text/javascript" charset="utf-8" src="~/Scripts/layer/layer.js"></script>
	<link rel="stylesheet" type="text/css" href="~/Content/Site.css" />
	<link rel="stylesheet" type="text/css" href="~/Content/Style.css" />
	<script type="text/javascript">
		var obj, j;
		var page = 0;
		var nowPage = 0;  //当前页
		var listNum = @ConstValues.DefaultListCount;  //每页显示的条数
		var PagesLen;   //总的页数
		var PageNum = 10;  //分页链接数(5个)

		$(function () {
			var language = "";
			@if (Request.Cookies["_culture"] == null) {
				<text>
				language = "@((User as ICISPrincipal).Language)";
				$("#hidCulture").val(language);
				$("#frmCulture").submit();
				</text>
			} else {
				<text>
				language = "@Request.Cookies["_culture"].Value";
				</text>
			}

			if (language == "@ConstValues.Language.Cn") {
				$("#cultureCn").css("background-color", "#c30d23");
				$("#cultureEn").css("background-color", "#7c7c7c");
				$("#mlogo").append('<img id="logo" src="../Images/homeImg/logo.png" />');

				$("#cultureEn").hover(function () {
					$(this).css("color", "#c30d23");
					$(this).css("background-color", "#fff");
				}, function () {
					$(this).css("color", "#fff");
					$(this).css("background-color", "#7c7c7c");
				})
			} else {
				$("#cultureCn").css("background-color", "#7c7c7c");
				$("#cultureCn").css("borderRight", "0px");
				$("#cultureEn").css("background-color", "#c30d23");
				$("#mlogo").append('<img id="logo" src="../Images/homeImg/login_enlogo2.png" />')

				$("#cultureCn").hover(function () {
					$(this).css("color", "#c30d23");
					$(this).css("background-color", "#fff");
				}, function () {
					$(this).css("color", "#fff");
					$(this).css("background-color", "#7c7c7c");
				})
			}

			var url = "@Url.Action(nameof(MeetingListController.GetData),
					nameof(MeetingListController).GetControllerName())";
			$.get(url, null, function (data, textStatus, jqXHR) {
				if (data.length > 0) {
					for (var index = 0; index < data.length; index++) {
						var span = "";
						if (data[index].allowHotel && data[index].allowTraffic) {
							span = "@Resources.MenuHotelTraffic";
						} else if (data[index].allowHotel) {
							span = "@Resources.Hotel";
						} else if (data[index].allowTraffic) {
							span = "@Resources.Traffic";
						}

						var hotelTraffic = "";
						if (span != "") {
							hotelTraffic = '<p><a id="r-book' + index + '" href="' + "@Url.Action(nameof(MeetingBookingController.Index),nameof(MeetingBookingController).GetControllerName())" + "?conferenceId=" + data[index].id + '">'
							+ '<input type="button" id="linkAc' + index + '" value="'+ span +'" name="" />'
							+'</a></p>'
						}

						var html = '<li>'
							+'<table cellpadding="0" cellspacing="0" border="0" width="100%">'
							+'<tr>'
							+ '<td class="date"><h5>' + data[index].startMonth + '</h5>'
							+ '<h3>' + data[index].startDay + '</h3>'
							+ '<h5>' + data[index].startYear + '</h5></td>'
							+ '<td class="title"><a id="r-url' + index + '" target="_blank">' + data[index].conferenceName + '</a></td>'
							+ '<td class="to">' + data[index].conferenceStartDate + data[index].conferenceEndDate + '</td>'
							+ '<td class="address">' + data[index].operateLocation + '</td>'
							+ '<td class="button"><p><a id="r-contribute' + index + '" href="' + "@Url.Action(nameof(MeetingContributeController.Index),nameof(MeetingContributeController).GetControllerName())" + "?conferenceId=" + data[index].id + '">'
							+ '<input type="button" id="linkAr' + index + '" value="@Resources.MeetingContribute" name="" />'
							+'</a></p>'
							+ '<p><a id="r-regist' + index + '" href="' + "@Url.Action(nameof(MeetingAttendenceController.Index),nameof(MeetingAttendenceController).GetControllerName())" + "?conferenceId=" + data[index].id + '">'
							+ '<input type="button" id="linkAb' + index + '" value="@Resources.MeetingAttendence" name="" />'
							+'</a></p>'
							+ hotelTraffic
							+'</td>'
							+'<td class="img"><img src="' + "@Url.Action(nameof(UtilityController.ConferenceImg), nameof(UtilityController).GetControllerName())" + "/" + data[index].id + '" ></td>'
							+ '</tr>'
							+'</table>'
							+'</li>'

						$("#page").append(html);

						if(!data[index].allowContribute || !data[index].hasContribute){
							$("#linkAr" + index).css("background", "#bebebe")
							$("#r-contribute" + index).attr("href", "javascript:void(0);")
							$("#r-contribute" + index).removeAttr("onclick")
							$("#r-contribute" + index).html('<span class="hide">@Resources.MeetingContribute</span>')
						}

						if(!data[index].allowRegister || !data[index].hasRegister){
							$("#linkAb" + index).css("background", "#bebebe")
							$("#r-regist" + index).attr("href", "javascript:void(0);")
							$("#r-regist" + index).removeAttr("onclick")
							$("#r-regist" + index).html('<span class="hide">@Resources.MeetingAttendence</span>')
						}

						if(hotelTraffic != "" && data[index].allowHotel && (!data[index].allowRegister || !data[index].hasHotel)){
							$("#linkAc" + index).css("background", "#bebebe")
							$("#r-book" + index).attr("href", "javascript:void(0);")
							$("#r-book" + index).removeAttr("onclick")
							$("#r-book" + index).html('<span class="hide">' + span + '</span>')
						}
						else if(hotelTraffic != "" && data[index].allowTraffic && (!data[index].allowRegister || !data[index].hasTraffic)){
							$("#linkAc" + index).css("background", "#bebebe")
							$("#r-book" + index).attr("href", "javascript:void(0);")
							$("#r-book" + index).removeAttr("onclick")
							$("#r-book" + index).html('<span class="hide">' + span + '</span>')
						}

						if (data[index].homePageUrl != null && data[index].homePageUrl != "") {
							$("#r-url" + index).attr("href", data[index].homePageUrl)
						} else {
							$("#r-url" + index).attr("href", "@Url.Action(nameof(MeetingMainController.Index), nameof(MeetingMainController).GetControllerName())" + "/" + data[index].conferenceNickName)
						}
					}

					obj = document.getElementById("page").getElementsByTagName("li");
					j = obj.length
					PagesLen = Math.ceil(j / listNum);
					upPage(0)
				}
				else {
					var htmlNoConference = '<img src="../images/NoConference.jpg" align="absmiddle" style="min-height:calc(100vh - 260px);width:1200px"/>'
					$("#page").append(htmlNoConference);
				}
			});
		});

		function upPage(p) {
			nowPage = p
			//内容的变换
			for (var i = 0; i < j; i++) {
				obj[i].style.display = "none"
			}
			for (var i = p * listNum; i < (p + 1) * listNum; i++) {
				if (obj[i]) obj[i].style.display = "block"
			}
			strS = '<a onclick="upPage(0)" class="disabled">@Resources.FirstPage</a>  '
			var PageNum_2 = PageNum % 2 == 0 ? Math.ceil(PageNum / 2) + 1 : Math.ceil(PageNum / 2)
			var PageNum_3 = PageNum % 2 == 0 ? Math.ceil(PageNum / 2) : Math.ceil(PageNum / 2) + 1
			var strC = "", startPage, endPage;
			if (PageNum >= PagesLen) { startPage = 0; endPage = PagesLen - 1 }
			else if (nowPage < PageNum_2) { startPage = 0; endPage = PagesLen - 1 > PageNum ? PageNum : PagesLen - 1 }//首页
			else { startPage = nowPage + PageNum_3 >= PagesLen ? PagesLen - PageNum - 1 : nowPage - PageNum_2 + 1; var t = startPage + PageNum; endPage = t > PagesLen ? PagesLen - 1 : t }
			for (var i = startPage; i <= endPage; i++) {
				if (i == nowPage) strC += '<a class="curpage" onclick="upPage(' + i + ')">' + (i + 1) + '</a> '
				else strC += '<a class="disabled" onclick="upPage(' + i + ')">' + (i + 1) + '</a> '
			}
			strE = ' <a onclick="upPage(' + (PagesLen - 1) + ')" class="disabled">@Resources.LastPage</a>  '
			strE2 = "@Resources.Total " + "<span style='color:red;'>" + PagesLen + "</span>" + " @Resources.Page  " + "<span style='color:red;margin-left:10px;'>" + j + "</span>" + " @Resources.MeetingItem";
			document.getElementById("innerpage").innerHTML = '<div style="float:left;font-weight:bold;margin-left:20px;color:#656565">'+strE2+ '</div><div style="float:right">'+ strS + strC + strE +'</div>'
		}
	</script>
</head>
<body id="main">
	<div class="mar" style="position:relative;z-index:999;">
		<div class="index">
			<!-- header start -->
			<div class="header02">
				<div class="t">
					<div class="fl"><img src="~/Images/homeImg/icon_01.png" align="absmiddle" width="16" />&nbsp;&nbsp;@Resources.Welcome@((User as ICISPrincipal).UserName)</div>
					<div class="fl">
						@using (Html.BeginForm(nameof(UtilityController.SetCulture), nameof(UtilityController).GetControllerName(), FormMethod.Post, new { id = "frmCulture" }))
						{
							<a href="javascript:$('#hidCulture').val('@ConstValues.Language.Cn');$('#frmCulture').submit();" id="cultureCn" class="cn">@Resources.Chinese</a>
							<a href="javascript:$('#hidCulture').val('@ConstValues.Language.En');$('#frmCulture').submit();" id="cultureEn" class="en">@Resources.English</a>
							<input type="hidden" id="hidCulture" name="culture"  />
						}
					</div>
					<div class="fl">
						<a href="@Url.Action(nameof(ProfileEditController.Index), nameof(ProfileEditController).GetControllerName())">@Resources.Menu_UserCenter</a>
						@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).IsCA) {
							<a href="@Url.Action(nameof(ConferenceHomeController.Index), nameof(ConferenceHomeController).GetControllerName())">@Resources.Menu_ConferenceManage</a>
						}
						@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).IsSA) {
							<a href="@Url.Action(nameof(SysConferenceMasterController.Index), nameof(SysConferenceMasterController).GetControllerName())">@Resources.Menu_SystemManage</a>
						}
						<a href="@Url.Action(nameof(MeetingApplyController.Index), nameof(MeetingApplyController).GetControllerName())">@Resources.MeetingApply</a>
					</div>
					<div class="fl">
						@using (Html.BeginForm(nameof(AccountController.LogOff), nameof(AccountController).GetControllerName(), FormMethod.Post, new { id = "frmLogoff" }))
						{
							@Html.AntiForgeryToken();
							<a href="javascript:$('#frmLogoff').submit();" class="qt">@Resources.Exit</a>
						}
					</div>
				</div>
				<div class="clear"></div>
			</div>
			<!-- header end -->
			<!-- container start -->
			<div class="container">
				<div class="fl" id="mlogo"></div>
				<div class="fr mainmenu">
					<ul>
						<li><a href="@Url.Action(nameof(HomeController.HelpLogin),nameof(HomeController).GetControllerName())"><h3>@Resources.Help</h3></a></li>
						<li><a href="@Url.Action(nameof(HomeController.AboutUsLogin),nameof(HomeController).GetControllerName())"><h3>@Resources.AboutUs</h3></a></li>
						<li><a href="#" class="s"><h3>@Resources.MeetingList</h3></a></li>
						<li><a href="@Url.Action(nameof(HomeController.Index),nameof(HomeController).GetControllerName())"><h3>@Resources.HomePage</h3></a></li>
					</ul>
				</div>
				<div class="clear"></div>
			</div>
			<!-- container end -->
		</div>
		<div style="border-top: 2px #d9d9d9 solid; height:10px;"></div>
		<div class="index">
			<!-- container start -->
			<div class="container">
				<!-- list start -->
				<ul class="list" id="page" style="min-height:calc(100vh - 341px);"></ul>
				<!-- list end -->
				<!-- page start -->
				<br /><div id="innerpage" style="text-align:right"></div>
				<!-- page end -->
			</div>
			<!-- container end -->
		</div>
		<!-- footer start -->
		<div class="footer">
			<p>&copy;@Resources.CopyRightOfCisSystem</p>
			<p id="CopyRightId" style="margin-top:-70px">
				<a href="@Resources.CopyRightOfCisSystemLinkOne" target="_blank" style="color:#999">@Resources.CopyRightOfCisSystemOne &nbsp;&nbsp;</a>
				<a href="@Resources.CopyRightOfCisSystemLinkTwo" target="_blank" style="color:#999"><img src="~/Images/police.png" style="position:relative; top:4px;" />@Resources.CopyRightOfCisSystemTwo</a>
			</p>
		</div>
		<!-- footer end -->
	</div>
</body>
</html>